import { request1 } from '../'


interface IFormType {
  username: string;
  password: string;
}
interface ILoginData {
  token: string,
  data: any[],
  code: number,
  message?: string,
  permissions: any[],
  userInfo?: any
}

export function goLoginAction(data: IFormType) {
  return request1.post<ILoginData>({
    url: '/api/login',
    data
  })
}

interface IMenuType {
  name: string
  type: number
  icon: string
  id: number
  url: string
  children?: IMenuType[]
}

export function getMenuData() {
  return request1.get<IMenuType[]>({
    url: '/api/get/menu'
  })
}

